import { ApiResponse } from "./api";

/**
 * Mock 配置接口
 */
export interface MockConfig {
  /** 是否启用 Mock */
  enable: boolean;
  /** 忽略以下前缀的请求，直接发送到真实接口 */
  ignore?: string[];
  /** 请求延时，单位毫秒 */
  timeout?: number;
}

/**
 * Mock 处理器类型定义
 */
export type MockHandler<T = any, P = any> = (
  params: P,
  request: {
    url: string;
    method: string;
    data: any;
    headers: Record<string, string>;
    config: any;
  }
) => Promise<ApiResponse<T>> | ApiResponse<T>;
